﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Business.Migrations
{
    public partial class demo06 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "CheckQId",
                table: "CheckDetail",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "RDetail",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    RPName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RPNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RSNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RUnit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RNum = table.Column<int>(type: "int", nullable: false),
                    RTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    RBase = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RPH = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RPack = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RGoodId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "RGoods",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    ConUnit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RTitle = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RPeo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    RHand = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RConP = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RGoods", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "RDetail");

            migrationBuilder.DropTable(
                name: "RGoods");

            migrationBuilder.DropColumn(
                name: "CheckQId",
                table: "CheckDetail");
        }
    }
}
